#include <iostream>
#include <vector>

class Tmp{
public:
    Tmp(){

    }
    Tmp(bool var)
    : flag(var)
    {}
private:
    bool flag;
};

class Example_InitializerList{
public:
    Example_InitializerList()
    : n(1), ptr(nullptr), vec(1,1), tmp(1)
    {
        init();
    }
    void init(){
        vec.push_back(1);
        // anything else
    }
private:
    int n;
    int *ptr;
    std::vector<int> vec;
    Tmp tmp;
};

////


class Example_implicitConversion{
public:
    Example_implicitConversion(int a, bool b)
    : _ma(a), _mb(b)
    {}
    
private:
    int _ma;
    bool _mb;
    std::vector<int> _mvec;
    const static int a = 10;
    const static double b = 10.0;
};

using conversion=Example_implicitConversion;
void foo(conversion a){     ///注意这里是传值传参.
	std::cout << "foo" << std::endl;
}
int main(){
    // #1先定义然后直接插入对象
    conversion c1(1,true);
    foo(c1);                    //
	// #2匿名对象
    foo(conversion(1,true));    //
    // #3隐式类型转换
    foo({1,true});              //
    const conversion& ref_con = conversion(1,true);
    const int* ptr = &3;
    const int& ref = 3;
    return 0;
}